/*
 * SimpleView.java
 *
 * Created on October 9, 2007, 11:08 AM
 *
 */
package org.osdtsystem.dataset;

import org.osdtsystem.hierarchy.HClass;
import org.osdtsystem.hierarchy.Hierarchy;

/**
 * A simple view without subviews.
 * @author Martin Haulrich and Matthias Buch-Kromann
 */
public class SimpleView implements View {
    final int index;

    /**
     * Constructor for simple view.
     * @param index the index of the feature in the dataset that this view supports
     */
    public SimpleView(int index) {
        this.index = index;
    }

    @Override
    public final String feature(Dataset dataset, int identifier) {
        return dataset.dataPoint(identifier).feature(index);
    }

    @Override
    public final View subview(int index) {
        throw new IllegalArgumentException("No subviews associated with simple view " + this);
    }

    @Override
    public final int subviews() {
        return 0;
    }
}
